Skip to content

Fix esds DSI parsing for truncated and duplicate DecSpecificInfo.#449

Open
kinetiknz wants to merge 1 commit intomasterfrom
esds_fixes
Open

Fix esds DSI parsing for truncated and duplicate DecSpecificInfo.#449
kinetiknz wants to merge 1 commit intomasterfrom
esds_fixes

Conversation

@kinetiknz
Copy link
Copy Markdown
Collaborator

@kinetiknz kinetiknz commented Apr 23, 2026

Record AOT, sample rate and channel count before the GASpecificConfig bit reads that can hit EOF on a truncated DSI. find_descriptor swallows BitReaderError in non-strict mode, so storing the fields afterwards left a playable-looking AAC track with no usable config and silent playback for HE-AAC streams with explicit SBR signalling. This is a fix for https://bugzilla.mozilla.org/show_bug.cgi?id=2011644

Also keep the first DecSpecificInfo and ignore subsequent ones in non-strict mode, matching Chromium and ffmpeg. The previous code concatenated DSI bytes and overwrote the parsed audio fields from the second DSI, leaving the ES_Descriptor inconsistent when the two disagreed. Strict mode still rejects duplicates with EsdsDecSpecificInfoTagQuantity.

@kinetiknz kinetiknz self-assigned this Apr 23, 2026
@kinetiknz
Copy link
Copy Markdown
Collaborator Author

@alastor0325 can you review this please?

Record AOT, sample rate and channel count before the GASpecificConfig
bit reads that can hit EOF on a truncated DSI.  find_descriptor swallows
BitReaderError in non-strict mode, so storing the fields afterwards left
a playable-looking AAC track with no usable config and silent playback
for HE-AAC streams with explicit SBR signalling.

Also keep the first DecSpecificInfo and ignore subsequent ones in
non-strict mode, matching Chromium and ffmpeg.  The previous code
concatenated DSI bytes and overwrote the parsed audio fields from the
second DSI, leaving the ES_Descriptor inconsistent when the two
disagreed.  Strict mode still rejects duplicates with
EsdsDecSpecificInfoTagQuantity.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant